import request from '@/utils/request'

// 组织架构页面的API

// 1.查询企业的部门列表
export const getDepartments = function() {
  return request.get('/company/department')
}

// 2.获取简单员工列表 - 在deptDialog中使用
export const getEmployeeSimple = function() {
  return request.get('/sys/user/simple')
}

// 3.新增部门API
export const addDepartments = function(data) {
  return request.post('/company/department', data)
}

// 4.删除部门
export const doDelDepartments = function(id) {
  return request.delete('/company/department/' + id)
}

// 5.编辑部门
export const getDepartmentsById = function(id) {
  return request.get('/company/department/' + id)
}

// 6.编辑部门 - 修改数据
export const upDataDepartment = function(data) {
  return request.put('/company/department/' + data.id, data)
}

